/**
 * 
 */
package com.fox.webapp.persistent;

import java.util.List;

import org.bson.types.ObjectId;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.fox.webapp.domain.Account;
import com.fox.webapp.domain.Broker;
import com.fox.webapp.domain.Person;
import com.fox.webapp.persistent.custom.AccountRepositoryCustom;

/**
 * @author yockii
 *
 */
public interface AccountRepository extends
PagingAndSortingRepository<Account, ObjectId>, AccountRepositoryCustom{

	List<Account> findByPerson(Person person);
	
	List<Account> findByPersonAndActiveIsTrue(Person person);
	
	Account findByIdAndPerson(ObjectId id, Person person);

	List<Account> findByActiveIsFalse();

	List<Account> findByAccountNo(String accountNo);

	List<Account> findByBrokerAndActiveIsNull(Broker broker);

	Account findByBrokerNameAndAccountNo(String brokerName, String accountNo);

}
